define(
	[
		'require',
		'apm/ui/business_rank',
		'apm/ui/business_time_ranges',
		'apm/ui/business_map'
	],
	function(require){
		var View = Ember.View.extend({
			RankChart: require("apm/ui/business_rank"),

			PositionMapChart: require('apm/ui/business_map').extend({
				init: function(){
					this.dataKeyChange();
					this._super();
				},

				dataKeyChange: Ember.observer("dataKey", function(){
					switch(this.get("dataKey")){
						case "system/response_time/avg":
							this.set("fmtType", "transform_time_ms");
							break;
						case "system/score/apdex":
							this.set("fmtType", undefined);
							break;
						case "network/bytes/total":
							this.set("fmtType", "transform_flow_mb");
							break;
						case "system/error/count":
							this.set("fmtType", undefined);
							break;
						case "system/user/unique":
							this.set("fmtType", undefined);
							break;
						case "system/throughput/total":
							this.set("fmtType", undefined);
							break;
					}
				}),

				_translateOther: function(option){
					this._super(option);
					option.dataRange.show = true;
				}
			}),

			TimeRanges: require('apm/ui/business_time_ranges'),

			didInsertElement:function(){
				var view = Broada.getView("timeRangeSelect");
				var content = Ember.A([
						{
							name: "前1小时",
							value: "1h"
						},
						{
							name: "前1天",
							value: "1d"
						},
						{
							name: "前1周",
							value: "7d"
						},
						{
							name: "前1个月",
							value: "1M"
						}
					]);
				view.set("content",content);
				var timeRangeView = Broada.getView("businessTimeRangesTopo");
				timeRangeView.$().hide();
			}
		});

		APM.BusinessDetailExperienceAreaView = View;

		return View;
	}
);